import Request from './index.js'
let request = new Request().http

function get(url, data, hideLoading, header) {
  return request({
    url: url,
    method: 'GET',
    data: data,
    header: header
  })
}
 
function post(url, data, hideLoading, header) {
  return request({
    url: url,
    method: 'POST',
    data: data,
    header: header,
    hideLoading: hideLoading,
  })
}
let api = {
  login: data => post('loginapi', data, true, true),
  getswiper:data=>get('/mobie-api/home/swiperList',data,true),
  recommonGoodsList:data=>get('/mobie-api/home/recommonGoodsList',data,true),
  getCategoryList:data=>get('/mobie-api/category/list',data,true),
  getCategoryProduct:data=>get('/mobie-api/category/products',data,true),
  getproductById:data=>post('/mobie-api/product',data,true),
  getproductByName:data=>post('/mobie-api/product/item',data,true),
}
 
export default api;